home *** CD-ROM | disk | FTP | other *** search
/ NBC Slam Jams! / NBC Slam Jams!.iso / xtras / media_la / effector.cst / 00029_Script_Push Dial < prev    next >
Text File  |  1997-09-30  |  3KB  |  77 lines

  1. -- Push Dial
  2.  
  3.  
  4.  
  5.  
  6. Property pSpeed, pInterp, pLeftLimit, pRightLimit, pStartDial, midSlope
  7.  
  8. on getPropertyDescriptionList
  9.   --if not alphamaniacCheck(the currentSpriteNum) then exit
  10.   
  11.   set pList=[:]
  12.   addProp pList,#pSpeed,[format:#integer,comment:"Speed of dial:", Default:6, range:[min:6,max:20]]
  13.   addProp pList,#pLeftLimit,[format:#integer,comment:"Left Limit (degrees):", Default:-90, range:[min:-360,max:360]]
  14.   addProp pList,#pRightLimit,[format:#integer,comment:"Right Limit (degrees):", Default:90, range:[min:-360,max:360]]
  15.   addProp pList,#pStartDial,[format:#integer,comment:"Start Dial Angle (degrees):", Default:0, range:[min:-360,max:360]]
  16.   addProp pList,#pInterp,[format:#symbol,¼
  17.                                comment:"Interpolation:",¼
  18.                                Default:#On,range:[#Off,#On,#Paused]]
  19.   
  20.   return pList
  21. end
  22.  
  23. on beginSprite me
  24.   set s=the spriteNum of me
  25.   if not alphaManiac(s) then exit
  26.   
  27.   set pInterp=interpolation(pInterp)
  28.   if not EffectActive(s, #rotate) then
  29.     rotate(sprite s, [degrees:pStartDial, interpolation:pInterp])
  30.   end if
  31.   set centerAngle = ((pRightLimit - pLeftLimit) / 2) + pLeftLimit
  32.   if (((centerAngle + 360) mod 360)-90) > 90 then 
  33.     set pSpeed  = pSpeed * -1
  34.   end if
  35. end
  36.  
  37. on mouseDown me
  38.   set s = the spriteNum of me
  39.   --set eighthWidth = (the width of sprite s) / 8
  40.   set centerL = ((the width of the rect of sprite s)/2)  + the left of sprite s
  41.   rotate(sprite s, [animMode:#static])
  42.   repeat while the mouseDown
  43.     set curAngle = GetAngle(sprite s, #rotate)
  44.     if the mouseH > centerL then
  45.       if((curAngle + pSpeed) < pRightLimit) and¼
  46. ((curAngle + pSpeed) > pLeftLimit) then
  47.         rotate(sprite s, [deltaDegrees:pSpeed])
  48.       end if
  49.     end if
  50.     if the mouseH < centerL  then
  51.       if((curAngle - pSpeed) > pLeftLimit) and¼
  52. ((curAngle - pSpeed) < pRightLimit) then
  53.         set ang = 0 - pSpeed
  54.         rotate(sprite s, [deltaDegrees:ang])
  55.       end if
  56.     end if
  57.     updateStage
  58.   end repeat
  59. end
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66. on getBehaviorDescription me
  67.   set msg= "Your AlphaManiac dial will rotate when it is clicked and held"
  68.   put return & return after msg
  69.   put "Parameters:" & return & "-----------" & return  after msg
  70.   put "*  Speed:  How fast does it turn?" & return after msg
  71.   put "*  Left Limit:  Left extreme of dial." & return after msg
  72.   put "*  Right Limit: Right extreme of dial." & return after msg
  73.   put "*  Start Dial Angle: angle to start the dial." & return after msg
  74.   put "*   Interpolation:   On,Off,or While Paused" after msg
  75.   put return & "-----------" & return & return  & ">>>" && amTip()  after msg
  76.   return msg
  77. end